// 审批
import Vue from "vue";
import API from "../requestApi/taskApi";
import { get, post, postUrlencoded } from "../requestApi/request";
const task = {
  // 新建消息
  webMessageCreateAndSendFun: function webMessageCreateAndSendFun(params) {
    return postUrlencoded(API.webMessageCreateAndSend, params);
  },
  // 消息删除
  getwebmessagedelete: function getwebmessagedelete(params) {
    return postUrlencoded(API.webmessagedelete, params);
  },
  // 消息详情
  webMessageDetailFun: function webMessageDetailFun(params) {
    let ip = `${API.webMessageDetail}?memberId=${params.memberId}&taskIds=${
      params.taskIds
    }`;
    return Vue.http.get(ip, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data);
      }
    });
  },
  // 消息列表
  webMessageListFun: function webMessageListFun(params) {
    let ip = `${API.webMessageList}?${params}`;
    return get(ip);
  }
};
export default task;
